package com.scs.application.core.mvc.converter;

import com.scs.application.core.utils.DateUtils;
import org.springframework.core.convert.converter.Converter;

import java.util.Date;


/**
 * 全局字符串转日期转换器，字符串格式可以为 DateUtils的parsePatterns
 * @see scs.application.core.utils.DateUtils#parsePatterns
 */
public class StringToDateConverter implements Converter<String, Date> {

    @Override
    public Date convert(String s) {
        return DateUtils.parse(s);
    }

}
